package com.tms.springboot.controller;


import com.tms.springboot.result.JsonResult;
import com.tms.springboot.result.ResultTool;
import com.tms.springboot.service.PdTruckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 车辆信息表 前端控制器
 * </p>
 *
 * @author cjj
 * @since 2023-06-14
 */
@RestController
@RequestMapping("/pd-truck")
public class PdTruckController {
    @Autowired
    private PdTruckService truckService;

    /**
     * todo 根据线路id，查询车次，车辆，司机的部分信息
     * @param transportLineId 线路id
     * @return
     */
    @GetMapping("/queryTripsDriverTruckByTransportLineId/{transportLineId}")
    public JsonResult queryTripsDriverTruckByTransportLineId(@PathVariable String transportLineId) {
        List<Map<String, Object>> map = truckService.queryTripsDriverTruckByTransportLineId(transportLineId);
        return map != null ? ResultTool.success(map) : ResultTool.fail();
    }

}
